{% extends 'base_template/base.html' %}
{% load  static %}
{% load mathfilters %}
{% block main_content %}
    <div class="card shadow">
        <div class="card-header py-3"><p class="text-primary m-0 fw-bold">成绩信息</p></div>
        <div class="card-body">
            <div class="row">
                <div class="col-md-6 text-nowrap">
                    <div id="dataTable_length" class="dataTables_length" aria-controls="dataTable"><label
                            class="form-label">显示<select
                            class="d-inline-block form-select form-select-sm">
                        <option value="10" selected="">10</option>
                        <option value="25">25</option>
                        <option value="50">50</option>
                        <option value="100">100</option>
                    </select>&nbsp;</label></div>
                </div>
                <div class="col-md-6">
                    <div class="text-md-end dataTables_filter" id="dataTable_filter"><label
                            class="form-label"><input type="search" class="form-control form-control-sm"
                                                      aria-controls="dataTable"
                                                      placeholder="搜索"></label></div>
                </div>
            </div>
            <div class="table-responsive table mt-2" id="dataTable" role="grid"
                 aria-describedby="dataTable_info">
                <table class="table my-0" id="dataTable">
                    <thead>
                    <tr>
                        <th>课程名称</th>
                        <th>总评成绩</th>
                        {#                        <th>课程代码</th>#}
                        {#                        <th>最终成绩</th>#}
                        {#                        <th>学年学期</th>#}
                        <th>绩点</th>
                    </tr>
                    </thead>
                    <tbody>
                    {% for study in studies %}
                        <tr>
                            {% if study.score > -1 %}
                                <td>{{ study.course.name }}</td>
                                <td>{{ study.score }}</td>
                                <td>
                                    {% if 90 <= study.score %}
                                        4
                                    {% elif 85 <= study.score %}
                                        3.7
                                    {% elif 80 <= study.score %}
                                        3.2
                                    {% endif %}
                                </td>
                            {% endif %}
                        </tr>
                    {% endfor %}

                    </tbody>
                </table>
            </div>
            {#            <div class="row">#}
            {#                <div class="col-md-6 align-self-center"><p id="dataTable_info" class="dataTables_info"#}
            {#                                                           role="status" aria-live="polite">Showing 1#}
            {#                    to {{ scores|length }}#}
            {#                    of {{ scores|length }}</p></div>#}
            {#                <div class="col-md-6">#}
            {#                    <nav class="d-lg-flex justify-content-lg-end dataTables_paginate paging_simple_numbers">#}
            {#                        <ul class="pagination">#}
            {#                            <li class="page-item disabled"><a class="page-link" href="#"#}
            {#                                                              aria-label="Previous"><span#}
            {#                                    aria-hidden="true">«</span></a></li>#}
            {#                            <li class="page-item active"><a class="page-link" href="#">1</a></li>#}
            {#                            <li class="page-item"><a class="page-link" href="#">2</a></li>#}
            {#                            <li class="page-item"><a class="page-link" href="#">3</a></li>#}
            {#                            <li class="page-item"><a class="page-link" href="#" aria-label="Next"><span#}
            {#                                    aria-hidden="true">»</span></a></li>#}
            {#                        </ul>#}
            {#                    </nav>#}
            {#                </div>#}
            {#            </div>#}
        </div>
    </div>
{% endblock main_content %}